package stark.app.function;

import android.content.Intent;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import com.chad.library.adapter.base.BaseQuickAdapter;

import stark.app.MainBaseFragment;
import stark.app.base.BaseWithFragmentActivity;
import stark.app.frame.TextItemBean;
import stark.app.function.ae.AudioEditDemoActivity;
import stark.app.function.apkextract.ApkExtractDemoActivity;
import stark.app.function.applock.AppLockDemoActivity;
import stark.app.function.appwidget.AppWidgetDemoActivity;
import stark.app.function.articlegen.ArticleGenDemoActivity;
import stark.app.function.beat.BeatDemoActivity;
import stark.app.function.calculator.CalculatorDemoActivity;
import stark.app.function.callrec.CallrecDemoActivity;
import stark.app.function.callshow.CallShowDemoActivity;
import stark.app.function.camerakit.CameraKitDemoActivity;
import stark.app.function.cartoon.CartoonDemoActivity;
import stark.app.function.castscreen.CastScreenDemoActivity;
import stark.app.function.catdog.CatDogDemoActivity;
import stark.app.function.chatbot.ChatbotDemoActivity;
import stark.app.function.chess.ChessDemoActivity;
import stark.app.function.compass.CompassDemoActivity;
import stark.app.function.dbconvert.DbConverterDemoActivity;
import stark.app.function.dialog.FuncDialogDemoActivity;
import stark.app.function.docviewer.DocViewerDemoFragment;
import stark.app.function.download.DownloadDemoActivity;
import stark.app.function.dream.DreamDemoActivity;
import stark.app.function.drivetest.DriveTestDemoActivity;
import stark.app.function.drumstand.DrumstandDemoFragment;
import stark.app.function.endic.EndicDemoActivity;
import stark.app.function.fdy.FdyDemoActivity;
import stark.app.function.filetransfer.FileTransferActivity;
import stark.app.function.finddiff.FindDiffDemoActivity;
import stark.app.function.g2048.Game2048DemoActivity;
import stark.app.function.game.GameDemoActivity;
import stark.app.function.gobang.GoBangDemoFragment;
import stark.app.function.guesstv.GuessTvDemoActivity;
import stark.app.function.handwrite.HandwriteDemoActivity;
import stark.app.function.idiom.IdiomDemoActivity;
import stark.app.function.imgedit.ImgEditDemoActivity;
import stark.app.function.imgmodel.ImgModelDemoFragment;
import stark.app.function.imgocr.ImgOcrDemoActivity;
import stark.app.function.irremote.IrRemoteDemoActivity;
import stark.app.function.jigsaw.JigsawDemoActivity;
import stark.app.function.map.MapDemoActivity;
import stark.app.function.markdown.MarkdownDemoFragment;
import stark.app.function.mindmap.MindMapDemoFragment;
import stark.app.function.more.MoreDemoActivity;
import stark.app.function.net_ping_ip.NetPingIpActivity;
import stark.app.function.netusage.NetUsageDemoActivity;
import stark.app.function.news.NewsDemoActivity;
import stark.app.function.nfc.NfcDemoActivity;
import stark.app.function.novelcreator.NovelCreatorDemoActivity;
import stark.app.function.novelreader.NovelReaderDemoActivity;
import stark.app.function.ocr.OcrDemoActivity;
import stark.app.function.paint.PaintDemoActivity;
import stark.app.function.pctrl.ParentCtrlDemoActivity;
import stark.app.function.pdf.PdfDemoActivity;
import stark.app.function.photomovie.PhotoMovieDemoActivity;
import stark.app.function.piano.PianoDemoFragment;
import stark.app.function.pixeldraw.PixelDrawDemoFragment;
import stark.app.function.playphone.PlayPhoneDemoActivity;
import stark.app.function.poster.PosterDemoActivity;
import stark.app.function.print.PrintDemoActivity;
import stark.app.function.recorder.MediaRecDemoActivity;
import stark.app.function.restartlife.RestartLifeDemoActivity;
import stark.app.function.riddle.RiddleDemoActivity;
import stark.app.function.screenshot.ScreenShotDemoActivity;
import stark.app.function.selectmedia.SelectMediaDemoActivity;
import stark.app.function.shortcut.ShortcutDemoActivity;
import stark.app.function.signtool.SignToolDemoActivity;
import stark.app.function.smalllan.SmalllanDemoActivity;
import stark.app.function.speechrec.SpeechRecDemoActivity;
import stark.app.function.step.StepCounterDemoActivity;
import stark.app.function.stkctrl.StkCtrlDemoFragment;
import stark.app.function.tbs.TbsDemoActivity;
import stark.app.function.teleprompter.TeleprompterDemoActivity;
import stark.app.function.translate.TranslateDemoActivity;
import stark.app.function.usersys.UserSysDemoActivity;
import stark.app.function.ve.VideoEditorDemoActivity;
import stark.app.function.view.CustomViewUseDemoActivity;
import stark.app.function.visualai.VisualAiFuncListFragment;
import stark.app.function.vplayer.VideoPlayerDemoActivity;
import stark.app.function.watermark.WatermarkDemoFragment;
import stark.app.function.weather.WeatherDemoActivity;
import stark.app.function.wifi.WifiConnectDemoActivity;
import stark.app.function.word.WordDemoActivity;

public class FunctionFragment extends MainBaseFragment {


    @Override
    public void addDefaultData() {
        mAdapter.addData(new TextItemBean("网络小工具", NetPingIpActivity.class));
        mAdapter.addData(new TextItemBean("文件传输", FileTransferActivity.class));//尚未完结
        mAdapter.addData(new TextItemBean("相机相关小工具", CameraKitDemoActivity.class));
        mAdapter.addData(new TextItemBean("图片视频素材选择器", SelectMediaDemoActivity.class));
        mAdapter.addData(new TextItemBean("视频编辑", VideoEditorDemoActivity.class));
        mAdapter.addData(new TextItemBean("更多信息", MoreDemoActivity.class));
        mAdapter.addData(new TextItemBean("海报制作", PosterDemoActivity.class));
        mAdapter.addData(new TextItemBean("拼图", JigsawDemoActivity.class));
        mAdapter.addData(new TextItemBean("图片编辑", ImgEditDemoActivity.class));
        mAdapter.addData(new TextItemBean("确认取消对话框", FuncDialogDemoActivity.class));
        mAdapter.addData(new TextItemBean("计算器", CalculatorDemoActivity.class));
        mAdapter.addData(new TextItemBean("下载工具", DownloadDemoActivity.class));
        mAdapter.addData(new TextItemBean("来电秀、壁纸", CallShowDemoActivity.class));
        mAdapter.addData(new TextItemBean("截长图", ScreenShotDemoActivity.class));
        mAdapter.addData(new TextItemBean("小说阅读器", NovelReaderDemoActivity.class));
        mAdapter.addData(new TextItemBean("图片文字识别", ImgOcrDemoActivity.class));
        mAdapter.addData(new TextItemBean("翻译", TranslateDemoActivity.class));
        mAdapter.addData(new TextItemBean("音频编辑", AudioEditDemoActivity.class));
        mAdapter.addData(new TextItemBean("媒体录制", MediaRecDemoActivity.class));
        mAdapter.addData(new TextItemBean("自定义控件", CustomViewUseDemoActivity.class));
        mAdapter.addData(new TextItemBean("游戏", GameDemoActivity.class));
        mAdapter.addData(new TextItemBean("创建应用快捷方式", ShortcutDemoActivity.class));
        mAdapter.addData(new TextItemBean("音乐相册", PhotoMovieDemoActivity.class));
        mAdapter.addData(new TextItemBean("视频预览播放", VideoPlayerDemoActivity.class));
        mAdapter.addData(new TextItemBean("投屏", CastScreenDemoActivity.class));
        mAdapter.addData(new TextItemBean("地图导航", MapDemoActivity.class));
        mAdapter.addData(new TextItemBean("艺术签名", SignToolDemoActivity.class));
        mAdapter.addData(new TextItemBean("象棋", ChessDemoActivity.class));
        mAdapter.addData(new TextItemBean("JSON转数据库", DbConverterDemoActivity.class));
        mAdapter.addData(new TextItemBean("仿抖音", FdyDemoActivity.class));
        mAdapter.addData(new TextItemBean("成语", IdiomDemoActivity.class));
        mAdapter.addData(new TextItemBean("谜语、歇后语、脑筋急转弯", RiddleDemoActivity.class));
        mAdapter.addData(new TextItemBean("绘画板", PaintDemoActivity.class));
        mAdapter.addData(new TextItemBean("周公解梦", DreamDemoActivity.class));
        mAdapter.addData(new TextItemBean("PDF", PdfDemoActivity.class));
        mAdapter.addData(new TextItemBean("WORD", WordDemoActivity.class));
        mAdapter.addData(new TextItemBean("驾考", DriveTestDemoActivity.class));
        mAdapter.addData(new TextItemBean("人生重开", RestartLifeDemoActivity.class));
        mAdapter.addData(new TextItemBean("提词器", TeleprompterDemoActivity.class));
        mAdapter.addData(new TextItemBean("英语词典", EndicDemoActivity.class));
        mAdapter.addData(new TextItemBean("看图猜电视剧", GuessTvDemoActivity.class));
        mAdapter.addData(new TextItemBean("小语种学习", SmalllanDemoActivity.class));
        mAdapter.addData(new TextItemBean("语音识别", SpeechRecDemoActivity.class));
        mAdapter.addData(new TextItemBean("万能遥控器", IrRemoteDemoActivity.class));
        mAdapter.addData(new TextItemBean("Wifi连接", WifiConnectDemoActivity.class));
        mAdapter.addData(new TextItemBean("天气预报", WeatherDemoActivity.class));
        mAdapter.addData(new TextItemBean("tbs(已弃用，请使用下面的办公文档查看器)", TbsDemoActivity.class));
        mAdapter.addData(new TextItemBean("办公文档查看器", DocViewerDemoFragment.class));
        mAdapter.addData(new TextItemBean("打印", PrintDemoActivity.class));
        mAdapter.addData(new TextItemBean("私密应用锁", AppLockDemoActivity.class));
        mAdapter.addData(new TextItemBean("流量统计", NetUsageDemoActivity.class));
        mAdapter.addData(new TextItemBean("玩手机时间限制", PlayPhoneDemoActivity.class));
        mAdapter.addData(new TextItemBean("指南针", CompassDemoActivity.class));
        mAdapter.addData(new TextItemBean("猫狗翻译器", CatDogDemoActivity.class));
        mAdapter.addData(new TextItemBean("看图找茬", FindDiffDemoActivity.class));
        mAdapter.addData(new TextItemBean("文章生成器", ArticleGenDemoActivity.class));
        mAdapter.addData(new TextItemBean("通话录制", CallrecDemoActivity.class));
        mAdapter.addData(new TextItemBean("手写模拟器", HandwriteDemoActivity.class));
        mAdapter.addData(new TextItemBean("新闻头条", NewsDemoActivity.class));
        mAdapter.addData(new TextItemBean("小说创作器", NovelCreatorDemoActivity.class));
        mAdapter.addData(new TextItemBean("2048游戏", Game2048DemoActivity.class));
        mAdapter.addData(new TextItemBean("机器人聊天", ChatbotDemoActivity.class));
        mAdapter.addData(new TextItemBean("小组件", AppWidgetDemoActivity.class));
        mAdapter.addData(new TextItemBean("家长控制", ParentCtrlDemoActivity.class));
        mAdapter.addData(new TextItemBean("用户系统", UserSysDemoActivity.class));
        mAdapter.addData(new TextItemBean("NFC", NfcDemoActivity.class));
        mAdapter.addData(new TextItemBean("计步统计", StepCounterDemoActivity.class));
        mAdapter.addData(new TextItemBean("卡通动漫", CartoonDemoActivity.class));
        mAdapter.addData(new TextItemBean("扫描识别", OcrDemoActivity.class));
        mAdapter.addData(new TextItemBean("节拍", BeatDemoActivity.class));
        mAdapter.addData(new TextItemBean("apk文件提取器", ApkExtractDemoActivity.class));
        mAdapter.addData(new TextItemBean("钢琴", PianoDemoFragment.class));
        mAdapter.addData(new TextItemBean("思维导图", MindMapDemoFragment.class));
        mAdapter.addData(new TextItemBean("视觉智能体验馆", VisualAiFuncListFragment.class));
        mAdapter.addData(new TextItemBean("去水印", WatermarkDemoFragment.class));
        mAdapter.addData(new TextItemBean("五子棋", GoBangDemoFragment.class));
        mAdapter.addData(new TextItemBean("架子鼓", DrumstandDemoFragment.class));
        mAdapter.addData(new TextItemBean("像素画", PixelDrawDemoFragment.class));
        mAdapter.addData(new TextItemBean("stkctrl库中好评等事件埋点", StkCtrlDemoFragment.class));
        mAdapter.addData(new TextItemBean("markdown格式转换", MarkdownDemoFragment.class));
        mAdapter.addData(new TextItemBean("神图定制", ImgModelDemoFragment.class));
    }

    @Override
    public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
        Class<?> clazz = mAdapter.getItem(position).getDestCls();
        if (clazz == null) return;

        try {
            startActivity(new Intent(mContext, clazz));
        } catch (Exception e) {
            String title = mAdapter.getItem(position).getName();
            BaseWithFragmentActivity.start(getContext(), title, (Class<? extends Fragment>) clazz);
        }
    }

}